import service from "../utils/request";

export function userLogin(loginParam) {
  return service.post("/api/user/login", loginParam);
}

export function getLoginUser() {
  return service.get("/api/user/getLoginUser");
}

export function userLogout() {
  return service.post("/api/user/logout");
}

export function getUser(id) {
  return service.get(`/api/user/get/${id}`);
}

export function userReg(user, token) {
  return service.post(`/api/user/reg?token=${token}`, user);
}

export function getUserList(current, filterParam) {
  return service.post("/api/user/list", filterParam, {
    params: {
      current,
    },
  });
}

export function updateUser(user) {
  return service.post("/api/user/update", user);
}

export function deleteUser(id) {
  return service.post(`/api/user/delete/${id}`);
}

export function updatePass(param) {
  return service.post("/api/user/updatePass", param);
}
